import { defineConfig } from "vite";
import uni from "@dcloudio/vite-plugin-uni";

import path from 'path'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [uni()],
  resolve: {
    alias: {
      "@": path.resolve(__dirname, 'src')
    }
  },
  build: {
    // 1600 KB
    chunkSizeWarningLimit: 1600,
  },
  server: {
    port: 20001,
    proxy: {
      '/api': {
        target: 'http://localhost:20011',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, '')
      }
    }
  }
});
